import { serviceCreate } from '../utils/request'
import { merge } from 'axios/lib/utils'
const http = serviceCreate({
  // baseURL: '/dv',
  // 表单提交
  emulateJSON: true
})
// @config {headers, emulateJSON, loading, msg, errMsg, disableInterceptor}
const methods = {
    // 获取频道页面推荐数据
    getRecommend (params, config) {
        params = merge({
            day: 7,
            context: ''
        }, params || {})
        return http.get('/channel/ranking', merge(config, { params }))
    },
    // 获取二级频道数据 { pn: 1, id: '', subid: '', ps: 6 }
    getDynamic (params, config) {
        params = merge({
            pn: 1,
            ps: 6
        }, params || {})
        return http.get('/channel/dynamic', merge(config, { params }))
    }
}

export default methods
